﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Data;

public partial class Default2 : System.Web.UI.Page
{

    clsDBOperation objDBOp = new clsDBOperation();
    Hashtable hstParameters = new Hashtable();
    DataSet dsadmin = new DataSet();
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnlogin_Click(object sender, EventArgs e)
    {
        if (txtPass.Text != "")
        {
            DataSet ds = new DataSet();
            hstParameters.Clear();
            hstParameters.Add("adminname", txtUserName.Text);
            hstParameters.Add("Password", txtPass.Text);
            hstParameters.Add("Action", "Check_user");
            ds = (DataSet)objDBOp.GetDataset("SP_Login_MAster", CommandType.StoredProcedure, hstParameters);
            if (ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    Session["dsGolbal"] = ds;
                    Response.Redirect("~/Admin/");
                    //----------
                }
                else
                {

                    lblError.Visible = true;
                    lblError.Text = "UserName or Password is Incorrect";
                }
            }
        }
    }
}
